<?php
/**
 * CreateTime: 2022/5/3 16:21
 */

namespace App\Func;

use App\Consts\TableConsts\TableConsts;
use Illuminate\Support\Facades\DB;
use Mockery\Exception;

class InstallFunc
{
    public function configDictionaryInstall(){
        DB::beginTransaction();
        try {
            DB::insert("INSERT INTO ".DB::connection()->getTablePrefix().TableConsts::CY_DATA_DICTIONARY_TABLE_NAME."
            (`dictionary_name`,`dictionary_key`,`dictionary_value`,`is_disable`) VALUES
                ('企业类型','EnterpriseType',1,1),
                ('客户类型','TypeClient',1,1),
                ('生产型','EnterpriseTypeProduction',1,1),
                ('贸易型','EnterpriseTypeTrade',2,1),
                ('A类客户','ClientTypeA',1,1),
                ('B类客户','ClientTypeB',2,1),
                ('C类客户','ClientTypeC',3,1),
                ('D类客户','ClientTypeD',4,1)
            ");
            DB::commit();
        }catch (Exception $exception){
            DB::rollBack();
        }

        dd("测试");
    }
}